﻿/*
=======================================================
    RoleDepartment【角色与部门】
=======================================================
*/

namespace Services
{
    public interface IRoleDepartmentRepository : IRepository<RoleDepartment>
    {
        int GetCountByDepartment(int departmentID);
    }


    public class RoleDepartmentRepository : BaseRepository<RoleDepartment>, IRoleDepartmentRepository
    {
        public RoleDepartmentRepository(ISqlSugarClient dB, ICurrentUser currentUser, IQuery<RoleDepartment> query)
            : base(dB, currentUser, query)
        {
        }

        #region GetCountByDepartment
        public int GetCountByDepartment(int departmentID)
        {
            return _query.GetQueryable().Where(x => x.DepartmentID == departmentID).Count();
        }
        #endregion
    }
}
